home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / misc / math / TCalcStats2c.lha / TCalcStats2c / Install_Tcalcstats2c < prev    next >
Encoding:
Text File  |  1999-07-03  |  6.7 KB  |  235 lines

  1. ; $VER: Install_TCalcStats2b (03.07.99)
  2. (procedure P-check-system-version
  3.  (if (< (/ @installer-version 65536) 43)
  4.   (abort "The TCalcStats2 installation script needs Installer\n"
  5.    "version 43 or higher. It is available from Aminet\n")
  6.  )
  7.  (set #exec-version (/ (getversion) 65536))
  8.  (if (< #exec-version 37)
  9.   (abort "TCalcStats2 needs Kickstart 2.04 or higher.\n")
  10.  )
  11.  (if (< #exec-version 39)
  12.   (set #ag-browser "AmigaGuide")
  13.   (set #ag-browser "MultiView")
  14.  )
  15. )
  16. (procedure P-select-start-directory
  17.   (set #HelpPattern "Stats_Help")
  18.   (set #ArexxPattern "Arexx")
  19.   (set #HelpDir "Help")
  20.   (set #LibPattern "Libs")
  21. )
  22.  
  23. (procedure P-select-destination-directory
  24.  (if (exists "Turbocalc:" (noreq))
  25.   (
  26.    (set #old-tcalc-assign 1)
  27.    (set #old-tcalc-assign-location (expandpath "Turbocalc:"))
  28.    (set @default-dest
  29.     (askdir
  30.      (prompt "Select the directory where you want to "
  31.       "install the main files. You already have a 'Turbocalc:' "
  32.       "assign on your system. I will install in the Arexx "
  33.       "drawer there (or the scripts will not work!).")
  34.      (help "Select the directory where you want to "
  35.       "install the main files. You already have a 'Turbocalc:arexx' "
  36.       "drawer on your system so please accept "
  37.       "the default or the scripts will not work!")
  38.      (default "Turbocalc:")
  39.     )
  40.    )
  41.     (set #final "Turbocalc:")
  42. ) (
  43.    (set #old-tcalc-assign 0)
  44.    (if (exists "Work:" (noreq))
  45.     (set @default-dest "Work:")
  46.     (set @default-dest "SYS:")
  47.    )
  48.    (set @default-dest
  49.     (askdir
  50.      (prompt "Select the directory where you want to "
  51.       "install the main files. An additional directory "
  52.       "will *NOT* be created at the location you specify. "
  53.     "You MUST put the files in the TurboCalc/arexx drawer "
  54.     "or the scripts will not work!!")
  55.      (help "Select the directory where you want to "
  56.       "install the main files. All arexx script files, the "
  57.       "turbocalc macro spreadsheet file  will be copied "
  58.       "to that directory during installation. A new directory "
  59.       "will *NOT* be created at the location you specify. "
  60.       "This means if you want TCalcStats2 to be installed in its "
  61.       "own directory then you need to create that directory "
  62.       "yourself first.")
  63.      (default @default-dest)
  64.     )
  65.    )
  66.   (set #final @default-dest)
  67.   )
  68.  )
  69. )
  70.  
  71. (procedure P-select-destination-help
  72.  (if (exists "Turbocalc:" (noreq))
  73.   (
  74.    (set #old-tcalc-assign 1)
  75.    (set #old-tcalc-assign-location (expandpath "Turbocalc:"))
  76.    (set @default-dest
  77.     (askdir
  78.      (prompt "Select the directory where you want to "
  79.       "install the help files. You already have a 'Turbocalc:' "
  80.       "assign on your system, so it is assumed that this "
  81.       "is the location that you want to use.")
  82.      (help "Select the directory where you want to "
  83.       "install the help files. Since you already have a 'Turbocalc:Help' "
  84.       "drawer on your system you should probably accept "
  85.       "the default.")
  86.      (default "Turbocalc:Help")
  87.     )
  88.    )
  89.   ) (
  90.    (set #old-tcalc-assign 0)
  91.    (if (exists "Work:" (noreq))
  92.     (set @default-dest "Work:")
  93.     (set @default-dest "SYS:")
  94.    )
  95.    (set @default-dest
  96.     (askdir
  97.      (prompt "Select the directory where you want to "
  98.       "install the Help files. An additional directory "
  99.       "will be created at the location you specify.")
  100.      (help "Select the directory where you want to "
  101.       "install the help files. Amigaguide and html help files "
  102.     "will be copied to a new directory during installation. "
  103.     "A new directory will be created at the "
  104.     "location you specify. This means if you want the help "
  105.     "files to be installed in another directory then "
  106.     "you need to create that directory yourself first.")
  107.      (default @default-dest)
  108.     )
  109.    )
  110.   )
  111.  )
  112. )
  113.  
  114.  
  115. (procedure P-copy-file
  116.  (copyfiles
  117.   (source (tackon #source-dir #to-copy))
  118.   (dest @default-dest)
  119.   (optional force)
  120.   (infos)
  121.  )
  122. )
  123.  
  124. (procedure P-add-to-startup
  125.  (if #old-tcalc-assign
  126.   (if (= (#old-tcalc-assign-location (expandpath @default-dest)))
  127.    (set #change-startup 0)
  128.    (set #change-startup 1)
  129.   )
  130.   (set #change-startup 1)
  131.  )
  132.  (if #change-startup
  133.    (if
  134.     (askbool
  135.      (prompt "It is NECESSARY that an assign "
  136.       "'Turbocalc:' is created for the TCalcStats2 installation. "
  137.       "Would you like Installer to make the required change "
  138.       "to your user-startup file ? "
  139.       "If you answer 'No' then you need to make the "
  140.       "addition yourself, manually, before you can use TCalcStats2.")
  141.      (help "It is NECESSARY that an assign "
  142.       "'Turbocalc:' is created for the TCalcStats2 installation "
  143.       "The arexx scripts need this to work properly! "
  144.       "If you answer 'No' then you need to make the "
  145.       "addition yourself, manually, before you can use TCalcStats2. "
  146.       "You should only answer with 'No' if you prefer to edit "
  147.       "the user-startup file yourself. If you answer 'No' then "
  148.       "a file 'addition-to-user-startup' will be created in the "
  149.       "Turbocalc installation directory instead. You need to add the "
  150.       "contents of that file to your user-startup file.")
  151.      (choices "Yes" "No")
  152.     )
  153.   (
  154.    (set @default-dest
  155.     (askdir
  156.      (prompt "Select the location where Turbocalc is "
  157.       "installed.")
  158.      (help "Select the drive/directory where Turbocalc "
  159.     "is installed.")
  160.      (default @default-dest)
  161.     )
  162.    )
  163.    (set #startup-addition (cat
  164.     "assign Turbocalc: \"" (expandpath @default-dest) "\"\n"
  165.     )
  166.    )
  167.     (startup "Turbocalc"
  168.      (command #startup-addition)
  169.      (prompt "Installer will modify your s:user-startup "
  170.       "script. The following lines will be added:\n\n"
  171.       #startup-addition)
  172.      (help "Installer will modify your s:user-startup "
  173.       "script. The following lines will be added:\n\n"
  174.       #startup-addition)
  175.     )
  176.     (textfile
  177.      (dest (tackon @default-dest "addition-to-user-startup"))
  178.      (append #startup-addition)
  179.     )
  180.    )
  181.   )
  182.  )
  183. )
  184.  
  185. (welcome "Welcome to the TCalcStats2 installation.\n")
  186.  
  187. (set app-name "TCalcStats2b")
  188.  
  189. (P-check-system-version)
  190.  
  191. (complete 0)
  192.  
  193. (set #SourceDir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  194.  (expandpath @icon))
  195. )
  196. (P-select-start-directory)
  197. (P-select-destination-directory)
  198.  
  199. (complete 10)
  200.  
  201. ; start actual installation
  202. (copyfiles
  203.  (prompt "Copying arexx scripts...")
  204.  (source #SourceDir)
  205.  (dest @default-dest)
  206.  (pattern #ArexxPattern)
  207.  (infos)
  208. )
  209. (complete 20)
  210. (copyfiles
  211.  (prompt "Copying arexx library files to libs:...")
  212.  (source (tackon #SourceDir "libs"))
  213.  (dest "libs:")
  214.  (all)
  215.  (optional force)
  216. )
  217. (complete 40)
  218.  
  219. (P-select-destination-help)
  220. (copyfiles
  221.  (prompt "Copying help files...")
  222.  (source #SourceDir)
  223.  (dest @default-dest)
  224.  (pattern #HelpPattern)
  225.  (infos)
  226. )
  227. (complete 80)
  228.  
  229. (set @default-dest #final)
  230. (P-add-to-startup)
  231.  
  232. (complete 100)
  233.  
  234. (exit "The installation of TcalcStats2 is finished.")
  235.